package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author hm
 * @version 1.0
 * @date Created in 2024/7/9 11:32
 */
@Mapper
public interface DishFlavorMapper {
    /**
     * 添加菜品口味
     * @param flavorList
     */
    void insert(List<DishFlavor> flavorList);
    @Delete("delete from dish_flavor where dish_id = #{ids}")
    void deleteById(Long ids);

    /**
     * 根据菜品id查询口味
     * @param id
     * @return
     */
    @Select("select * from dish_flavor where dish_id = #{dishId}")
    List<DishFlavor> getByDishId(long id);
}
